<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
  <title>Log for Tango</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="GENERATOR" content="Quanta Plus">
  <link HREF="default.css" TYPE="text/css" REL="STYLESHEET" >
</head>
<body>
<div align="center"><h1>Log4Tango</h1></div>
<h2>Introduction</h2>
<p>
"Log4Tango" is a light and custom version of <a href="http://sourceforge.net/projects/log4cpp/">Log4cpp</a> for <a href=http://www.tango-controls.org>Tango</a>.
Log4cpp is library of C++ classes for flexible logging to miscelaneous destinations.
It is modeled after the <a href="http://jakarta.apache.org/log4j">Log4j</a> Java library.
</p>

<h2>Download</h2>
<p>
log4tango is part of the TANGO distribution. There is no way to obtain log4tango individually.
</p>

<h2>Building Log4Tango</h2>
<p>
The pthread (i.e. POSIX thread) library is required to compile log4tango.<br><br>
log4tango can be build using autoconf on platforms that support it. Simply do:
<pre>
./configure
make
make check
make install
</pre>
<p>This will install log4tango under /usr/local. To install in another localation specify --prefix=&lt;location&gt; when running configure.
</p>

<h3>Options for ./configure</h3>

Besides the usual ./configure options like --prefix a few others are available:

<dl>
<dt>--enable-doxyen</dt>
<dd>Enables generation of API documentation by Dimitri van Heeschs Doxygen tool
(http://www.doxygen.org/). Defaults to yes if doxygen can be found in the
search path.</dd>
</dl>

<dl>
<dt>--enable-html-docs</dt>
<dd>If doxygen is enabled, have it generate HTML formatted documentation.</dd>
</dl>

<dl>
<dt>--enable-latex-docs</dt>
<dd>If doxygen is enabled, have it generate LaTeX formatted documentation.</dd>
</dl>

<dl>
<dt> --enable-dot</dt>
<dd>Let Doxygen use the 'dot' tool of GraphViz (<a href="http://www.graphviz.org/">http://www.graphviz.org</a>) todraw its graphs.</dd>
</dl>

</p>

<h3>Build notes for specific platforms</h3>

<dl>
<dt>*nix (including Linux) - g++ compiler</dt>
<dd>Log4cpp should build whitout modification on any decent *nix system with g++ and GNU make. The primary development platform is
RedHat Linux 7.3, which has g++ 2.96-rh, but the aim is to be compatible with from g++ 2.95 and up. When g++ 3.x has been widely
adopted we may drop support for older g++ versions.</dd>
</dl>
<dl>
<dt>Solaris - Sun CC compiler</dt>
<dd>Compilation with Suns CC compiler requires setting some enviroment variables.
Also static libraries appear not to work. In short do:
<pre>
CC=CC CXX=CC LD="CC -KPIC" ./configure --disable-static
</pre>
</dd>
</dl>

<dl>
<dt>Win32 - MSVC++ 6</dt>
<dd>Use the workspace and project files in subdirectory msvc6.
You may need to adjust include/log4cpp/config-win32.h and the project files to your particular needs.</dd>
</dl>

<h2>Releases</h2>
<p>
<dl>
<dt>2.2.0 - based on log4cpp-0.3.4b (24 February 2003)</dt>
<dd> </dd>
</dl>

<h2>Documentation</h2>
<p>API Documentation generated by <a href="http://www.doxygen.org/" name="Doxygen">Doxygen</a> can be found
<a href="api/index.html">here</a>.<br>
</p>
<h2>FAQ</h2>

<h3>1. GENERAL</h3>
<h4>1.1. What is Log for C++?</h4>
Log for C++ is a library of C++ classes for flexible logging to misc. destinations. It is modeled after the Log for Java
library (http://jakarta.apache.org/log4j/).

<h4>1.2. How is Log for C++ related to Log4j? Is it a straight port?</h4>
Log for C++ strives to supply a similar interface for logging in C++ as Log4j provides in Java. However the implementation is not a
translation of the Java code. So in that sense it is not a 'port' of Log4j. Of course Log for C++ does owe many of its concepts to log4j.

<h4>1.3. What is the name of this project, 'Log for C++' or 'log4cpp'?</h4>
The 'official' long name of the project is 'Log for C++', but in practice, the short name, 'log4cpp' has proven more convinient.

<h4>1.4. Under which license is Log for C++ available?</h4>
As of version 0.2.1 Log for C++ is released under the GNU Lesser General Public License (LGPL).
Versions before that have been released under the GPL. See the license discussion on the forum at SourceForge
for the motivations behind switching from GPL to LGPL.

<h4>1.5. Our legal department doesn't like the LGPL, can you release Log for C++ under license XYZ?</h4>
No.<br>
Long answer: Technically it may be possible if every contributor agrees, which due to their growing number has become increasingly
difficult. But even if that could be overcome it will not happen.<br>
Of course the LGPL does grant you the opportunity to choose the GPL instead of the LGPL, but I bet XYZ != GPL.

<h3>2. COMPILATION AND INSTALLATION</h3>

<h3>3. USAGE</h3>
<h4>3.1. I've succesfully compiled log4cpp, now how do I use this stuff?</h4>
For some small examples using log4cpp, see the 'tests' subdirectory. Also see the documentation section for a pointer for API documentation
and more usage information.

<h4>3.2. Is log4cpp thread-safe?</h4>

<h3>4. PROBLEMS AND ERROR MESSAGES</h3>
<h4>4.1. I get 'Naming collision for 'ERROR' detected. Please read the FAQ for a workaround.'</h4>
This is caused by the rudeness of some platforms, which mutilate the namespace with some blunt #defines. To be more precise,
the Win32 API includes #defines of 'ERROR' and 'DEBUG'. Since the preprocessor is unaware of C++ naming scopes this results in
reserving the words ERROR and DEBUG litterally everywhere. In particular this conflicts with log4cpp::Prioritiy::ERROR and
log4cpp::Priority::DEBUG. These latter two names come from log4j, so they are not something we made up ourselves.<br>
They Win32 authors should not have rudelessly claimed these generic names through the preprocessor. There are much better alternatives:
<ol>
<li>If they use it as an integer constant, declare it using a language construct.
Either '<tt>enum {ERROR=1};</tt>' or '<tt>static const int ERROR=1;</tt>' would do fine.</li>
<li>Use a less generic name like WIN32API_ERROR to make naming conflicts less likely</li>
<li>In case they use it as a flag for conditional compilation, use '<tt>#define DEBUG DEBUG</tt>' and '<tt>#if defined(DEBUG)</tt>'.
In that case the preprocessor would simply replace all occurrences of 'DEBUG' in the source code with 'DEBUG', in effect leaving
everything intact.</li>
</ol>
<p>Of course the proper solution would be if the offending party would use one of the above methods, but we could have to wait
some time for this to actually happen. As an alternative log4cpp can workaround these #defines. The workaround code is enabled by
doing <tt>#define LOG4CPP_FIX_ERROR_COLLISION 1</tt> before #including any log4cpp header files and after #including all
platform headers. For Win32 platforms this #define has already been included in log4cpp/config-win32.h.
</p>
<p>Once log4cpp has been updated to the log4j 1.2 API we can get rid of this problem by adopting the new names for log levels.
</p>

<h4>4.2. I am trying to compile/link the log4cpp package using the SunWorkshop compiler (CC) on a Solaris 7 machine.
The library builds, but the testmain code fails to link properly.</h4>

A proper solution for this problem has not been found yet (suggestions are welcome),
but James Emery reported success with the following workaround:
 <ul>
<li>Disable building of the static library</li>
<li>Change the linker from /usr/ucb/ld to CC and enable 'place independent code' (pic).</li>
</ul>
In short, configure with:<br>
<pre>export LD="CC -Kpic" && ./configure --disable-static</pre>

<h4>4.3. ./configure fails to detect 'snprintf()' on platform XYZ.</h4>
./configure does not just check for the presence of a snprintf() function but for C99 compliancy as well. In particular, snprintf()
should strictly honour the 'string size' parameter to avoid potential buffer overflow problems.
log4cpp falls back to an <a href="http://www.ijs.si/software/snprintf/">alternative snprintf() implementation</a> if the OS does not provide a correct one.

<h2>Status</h2>
<p>As of version 0.3.0 log4cpp has a separate 'stable' and 'development' branches.
Releases x.y.z where y is even are considered stable and those where y is odd are experimental
(which means that some or all features may be broken).</p>
<p>The latest stable release 0.2.7. New releases of 0.2.x are for bug fixes only, new features will go into 0.3.x and eventually 0.4.x.</p>

<h2>People</h2>
<p>Coding on Log4cpp was initiated by me (Bastiaan Bakker) late 2000. Since then other people have joined the project or contributed code:
<table>
<tr><td>Cedric Le Goater &lt;cedric(at)legoater.com&gt;</td><td>autoconf setup, various improvements</td></tr>
<tr><td>Marc Welz &lt;marc(at)jade.cs.uct.ac.za&gt;</td><td>IdsaAppender</td></tr>
<tr><td>Lynn Owen &lt;opl(at)agoby.com&gt;</td><td>MSVC++ support</td></tr>
<tr><td>Steve Ostlind &lt;s.ostlind(at)pentasafe.com&gt;</td><td>MSVC++ support, various fixes</td></tr>
<tr><td>Marcel Harkema &lt;marcel(at)debian.org&gt;</td><td>Debian packaging</td></tr>
<tr><td>Uwe J�er &lt;jaeger(at)varial.de&gt;</td><td>Borland C++ Builder support</td></tr>
<tr><td>Walter Stroebel &lt;walter.stroebel(at)lifeline.nl&gt;</td><td>RemoteSyslogAppender</td></tr>
<tr><td>Glen Scott &lt;glen_s(at)yahoo.com&gt;</td><td>PatternLayout, SimpleConfigurator</td></tr>
<tr><td>Tony Cheung &lt;dragonman(at)asiayeah.com&gt;</td><td>OpenVMS support</td></tr>
<tr><td>Alex Tapaccos &lt;ATapaccos(at)redfig.com&gt;</td><td>DailyRollingFileAppender</td></tr>
<tr><td>Brendan B. Boerner &lt;bboerner(at)texas.net&gt;</td><td>Multiple Appender support for Categories</td></tr>
<tr><td>Paulo Pizarro &lt;paulo.pizarro(at)digitro.com.br&gt;</td><td>RollingFileAppender</td></tr>
<tr><td>David Resnick &lt;dresnick(at)mobilespear.com&gt;</td><td>NTEventAppender, integration work</td></tr>
<tr><td>Aaron Ingram &lt;ai8(at)yahoo.com&gt;</td><td>MSThreads support</td></tr>
<tr><td>Alan Anderson &lt;alan(at)rushmore.com&gt;</td><td>Win32DebugAppender, PropertyConfigurator</td></tr>
<tr><td>Emiliano Martin &lt;emilianomc(at)terra.es&gt;</td><td>PThreads support</td></tr>
</table>
</p>

<h2>Project Pages</h2>
<p>
<table border="0">
<tr><td><a href="http://sourceforge.net"> <img src="sflogo.png" align="left" border="0" alt="SourceForge Logo"></a></td>
<td>Log4cpp is hosted on <a href="http://sourceforge.net/">SourceForge<a> at <a href="http://sourceforge.net/projects/log4cpp/">http://sourceforge.net/projects/log4cpp/</a>.</td></tr>
</table>
</p>
<h2>Related Projects</h2>
<p>Log4cpp is but one of many ports/implementations of the Log4j API. Here's an incomplete list:
  <table>
     <tr><td><a href="http://log4c.sourceforge.net"><b>log4c</b></a></td><td>An implementation in C by Cedric Legoater</td></tr>
     <tr><td><a href="http://log4cplus.sourceforge.net/"><b>log4cplus</b></a></td><td>An indepent C++ implementation by Tad Smith.
     Worth checking out if you don't like Log4cpp for some reason.</td></tr>
   </table></p>
</body>
</html>

<h2>License</h2>
<p>As of version 0.2.1 this library is licensed under the Lesser General Public License instead of the General Public License.
No further license changes are planned :-). </p>

<pre>
Log for C++ (short name: log4cpp), a C++ library for flexible logging.
Copyright (C) 2000-2002 LifeLine Networks bv
Copyright (C) 2000-2002 Bastiaan Bakker
Portions Copyright others, see file THANKS and source code.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
</pre>

</body>
</html>
